import request from '@/utils/request'

export function getTraceProcess(processInstanceId) {
  return request({
    url: `api/flow/traceProcess/${processInstanceId}`,
    method: 'post',
    params: {
      processInstanceId
    },
    responseType: 'blob'
  })
}

export function getAllTask(data) {
  return request({
    url: 'api/taskManage/allTask',
    method: 'post',
    data: data
  })
}

export function getHistory(processInstanceId, queryParams) {
  return request({
    url: `api/flow/history/${processInstanceId}`,
    method: 'get',
    params: queryParams
  })
}

export function getsSharingAppDetail(businessKey, queryParams) {
  return request({
    url: `/api/sharingApp/detail/${businessKey}`,
    method: 'get',
    params: queryParams
  })
}

export function getDelApplication(id) {
  return request({
    url: `api/catalogUpperLower/delApplication/${id}`,
    method: 'get'
  })
}

export function getDelSharingApp(id) {
  return request({
    url: `/api/sharingApp/delSharingApp/${id}`,
    method: 'get'
  })
}

export function getMyCompletedTasks(data) {
  return request({
    url: 'api/taskManage/myCompletedTasks',
    method: 'post',
    data: data
  })
}

export function getCatalogDetail(appNum) {
  return request({
    url: `api/taskManage/catalogDetail/${appNum}`,
    method: 'get'
  })
}

export function getInteractDetail(appNum) {
  return request({
    url: `api/interact/detail/${appNum}`,
    method: 'get'
  })
}

export function getDeletebyspbh(appNum) {
  return request({
    url: `api/interact/deletebyspbh/${appNum}`,
    method: 'get'
  })
}

export function getAddsupervision(id) {
  return request({
    url: `api/supervision/addsupervision/${id}`,
    method: 'get'
  })
}

export function getSupervisionDetail(spbh) {
  return request({
    url: `api/supervision/supervisionDetail/${spbh}`,
    method: 'get'
  })
}

export function getDatataskDelApp(dbbh) {
  return request({
    url: `api/datatask/delApp/${dbbh}`,
    method: 'get'
  })
}
export function getSupervisionDelsv(dbbh) {
  return request({
    url: `api/supervision/delsv/${dbbh}`,
    method: 'get'
  })
}

export function getDatataskDetail(id) {
  return request({
    url: `api/datatask/detail/${id}`,
    method: 'get'
  })
}

export function getDatataskUpdate(data) {
  return request({
    url: 'api/datatask/update',
    method: 'post',
    data: data
  })
}

export function getDatataskDelete(data) {
  return request({
    url: 'api/datatask/delete',
    method: 'post',
    data: data
  })
}

export function getspr() {
  return request({
    url: 'api/datatask/getspr',
    method: 'get'
  })
}

export function getDetailBySpbh(spbh) {
  return request({
    url: `api/datatask/detailBySpbh/${spbh}`,
    method: 'get'
  })
}

export function getDeletebyid(id) {
  return request({
    url: `api/datatask/deletebyid/${id}`,
    method: 'get'
  })
}
